// 发送单条短信示例
'use strict';
exports.main = async (event, context) => {
  try {
    const res = await uniCloud.sendSms({
      appid: '__UNI__AE607D4',
      smsKey: '8516bc16ca57a7194c8df5ad4205208d',
      smsSecret: 'b493ddc5090b42df98e32b1966360de6',
      phone: event.tel,
      templateId: '16754', // 请替换为自己申请的模板id
      data: {
        name: '道盟信息',
        code: event.code,
        expMinute: '3',
      }
    })
    return res
  } catch(err) {
    // 调用失败
    console.log(err.errCode)
    console.log(err.errMsg)
    return {
      code: err.errCode,
      msg: err.errMsg
    }
  }
};